﻿package org.demo.book;

import java.util.ArrayList;
import java.util.List;

import org.demo.book.BookAbstractBoard;
import org.demo.book.BookGameConf;
import org.demo.book.BookInstance;

/**
 * Description: 游戏区域
 * <br/>site: <a href="http://weibo.com/u/1679839007">nonoob</a> 
 * <br/>Copyright (C), 1989-2011, Hongxu Chen
 * <br/>This program is protected by copyright laws.
 * <br/>Program Name:
 * <br/>Date:2011-11-15
 * @author  Hongxu Chen leftcopy.chx@gmail.com
 * @version  1.0
 */
public class BookBoard extends BookAbstractBoard
{
	protected List<BookInstance> createBooks(BookGameConf config,
		BookInstance[][] books)
	{
		// 创建一个BookInstance集合, 该集合里面存放初始化游戏时所需的BookInstance对象
		List<BookInstance> notNullBooks = new ArrayList<BookInstance>();
		for (int i = 0; i < books.length; i++)
		{
			for (int j = 0; j < books[i].length; j++)
			{
				    //构造BookInstance对象, 并加到集合中
					BookInstance book = new BookInstance(i, j);
					// 添加BookInstance集合中
					notNullBooks.add(book);
			}
		}
		return notNullBooks;
	}
}
